import request from "@/utils/request";
import cfg from "@/config/config";

const leave = {
//获取请假单列表（不用）
    getBdLeaveOrderList: param => {
        return request(
            "post",
            cfg.apiUrl + "bdLeaveOrder/getBdLeaveOrderList",
            param
        );
    },
    //根据单号获取详单人员信息
    getUsersOfOrder: param => {
        return request(
            "post",
            cfg.apiUrl + "bdLeaveOrder/getUsersOfOrder",
            param
        );
    },
    //获取假类信息
    getLeaveType: param => {
        return request(
            "get",
            cfg.apiUrl + "api/sys/base/leaveType",
            param
        );
    },
    //保存请假单
    saveLeave: param => {
        return request(
            "post",
            cfg.apiUrl + "bdLeaveOrder/saveLeave",
            param
        );
    },
    //考勤卡表格补请假 保存请假.
    saveAttendanceCardLeave: param => {
        return request(
            "post",
            cfg.apiUrl + "bdLeaveOrder/saveAttendanceCardLeave",
            param
        );
    },
    //请假审批
    doApproval: param => {
        return request(
            "post",
            cfg.apiUrl + "bdLeaveOrder/doApproval",
            param
        );
    },
    //删除假单
    deleteLeave: param => {
        return request(
            "post",
            cfg.apiUrl + "bdLeaveOrder/deleteLeave",
            param
        );
    },
    //删除假单
    deleteLeaveOfPersonal: param => {
        return request(
            "post",
            cfg.apiUrl + "bdLeaveOrder/deleteLeaveOfPersonal",
            param
        );
    },
    //验证要取消的假单是否包含封账范围
    getOrderNoByFz: param => {
        return request(
            "get",
            cfg.apiUrl + "bdLeaveOrder/getOrderNoByFz",
            param
        );
    },
    /**
     * 根据单据ID获取请假单详情
     * @param param
     */
    getLeaveOrderById(param) {
        return request(
            "get",
            cfg.apiUrl + "bdLeaveOrder/detail",
            param
        );
    }
};

export default leave;
